<?php

namespace App\Http\Controllers\CRM;

use App\Http\Controllers\Controller;
use App\Http\Resources\CRM\MemberMoneyLogResource;
use App\Http\Resources\CRM\MemberMoneyResource;
use App\Models\Member;
use Illuminate\Http\Request;

class MemberMoneyController extends Controller
{
    public function getInfo(Member $member)
    {
        return new MemberMoneyResource($member);
    }

    public function getMoneyLogs(Member $member)
    {
        $logs = $member->moneyLogs()->latest()->paginate();

        return MemberMoneyLogResource::collection($logs);
    }
}
